import { HttpServer, WsServer } from "tsrpc";
import { ecs } from "../../core/ecs/ECS";
import { RoomServiceModelComp } from "./model/RoomServiceModel";
import { RoomServiceStartComp, RoomServiceStartSystem } from "./system/RoomServiceStartSys";
import { RoomJoinSystem } from "../../module/room/system/RoomJoinSystem";


/**
 * 账号服务提供以下服务：
 * 1.提供账号创建
 * 2.提供账号验证
 * 3.提供sso解析账号信息
 * 4.提供生成sso
 */


@ecs.register(`RoomService`)
export class RoomService extends ecs.Entity {
    RoomServiceModel!: RoomServiceModelComp;

    protected init() {
        this.addComponents<ecs.Comp>(
            RoomServiceModelComp);
    }


    start() {
        this.add(RoomServiceStartComp);
    }
    
    
}

export class EcsRoomSystem extends ecs.System {
    constructor() {
        super();

        this.add(new RoomServiceStartSystem());
        this.add(new RoomJoinSystem());
    }
}

export class RoomServiceRootSystem extends ecs.RootSystem {
    constructor() {
        super();
        this.add(new EcsRoomSystem());
    }
}